package collection.set;

import java.util.TreeSet;

public class Test3 {
    public static void main(String[] args) {
        TreeSet<String> ts = new TreeSet<>(((o1, o2) -> (o1.length() - o2.length()) == 0 ? o1.compareTo(o2) : o1.length() - o2.length()));

        ts.add("c");
        ts.add("ab");
        ts.add("df");
        ts.add("qwer");
        System.out.println(ts);
    }

}

